package cn.bluemobi.platform.controller.pointsRebate;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.bluemobi.common.core.dto.PageCondition;
import cn.bluemobi.platform.core.controller.PlatformBaseController;
import cn.bluemobi.platform.core.dto.DatatablePage;
import cn.bluemobi.platform.service.PointsRebateService;

/**
 * 积分返利管理controller
 * 
 * @author qifnagke
 * 
 */
@Controller
@RequestMapping("/admin/pointsRebate")
public class PointsRebateController extends PlatformBaseController {

	@Autowired
	private PointsRebateService pointsRebateService;

	@RequestMapping("/toPointsRebatePage")
	public String toPointsRebatePage(ModelMap model,
			@RequestParam(value = "memberId", required = false) String memberId) {
		model.put("memberId", memberId);
		return "pointsRebate/pointsRebateList";
	}

	@RequestMapping("/findPointsRebates")
	@ResponseBody
	public DatatablePage findPointsRebates(PageCondition cond) {
		return new DatatablePage(cond,
				pointsRebateService.findPointsRebates(cond));
	}
}
